package featuremodel;

import java.util.LinkedList;
import java.util.Vector;

import skyblue.Constraint;
import skyblue.Variable;

public class FeatureGroup {

	private Vector<Variable> variables;
	private String predicateType;
	private LinkedList<Constraint> constraints;

	// For dependency analysis
	// private boolean isPropagated;
	// private boolean isPFromFeatures;
	// private boolean isPropagatedSuccessfull;
	// private int count;

	public FeatureGroup(Vector<Variable> variables, String predicateType) {

		this.variables = variables;
		this.predicateType = predicateType;
//		this.isPropagated = false;
//		this.isPFromFeatures = false;
//		this.isPropagatedSuccessfull = false;
//		this.count = 0;
		this.constraints = new LinkedList<Constraint>();

		FeatureRep fp = null;
		for (int i = 0; i < variables.size(); i++) {
			fp = (FeatureRep) variables.get(i).getValue().getValuerep();
			fp.getFeatureGroups().add(this);
		}
	}

	public Vector<Variable> getVariables() {
		return variables;
	}

	public void setVariables(Vector<Variable> variables) {
		this.variables = variables;
	}

//	public boolean isPropagated() {
//		return isPropagated;
//	}
//
//	public void setPropagated(boolean isPropagated) {
//		this.isPropagated = isPropagated;
//	}
//
//	public boolean isPFromFeatures() {
//		return isPFromFeatures;
//	}
//
//	public void setPFromFeatures(boolean isPFromFeatures) {
//		this.isPFromFeatures = isPFromFeatures;
//	}
//
//	public boolean isPropagatedSuccessfull() {
//		return isPropagatedSuccessfull;
//	}
//
//	public void setPropagatedSuccessfull(boolean isPropagatedSuccessfull) {
//		this.isPropagatedSuccessfull = isPropagatedSuccessfull;
//	}
//
//	public int getCount() {
//		return count;
//	}
//
//	public void setCount(int count) {
//		this.count = count;
//	}

	public String getPredicateType() {
		return predicateType;
	}

	public void setPredicateType(String predicateType) {
		this.predicateType = predicateType;
	}

	public LinkedList<Constraint> getConstraints() {
		return constraints;
	}

	public void setConstraints(LinkedList<Constraint> constraints) {
		this.constraints = constraints;
	}

}
